package com.tianzeculture.stagebao.net;

import com.tianzeculture.stagebao.bean.ResultBean;
import com.tianzeculture.stagebao.net.base.AppBaseRestUsageV2;
import com.tianzeculture.stagebao.network.net.httpclient.NewCustomResponseHandler;
import com.tianzeculture.stagebao.util.Util;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2018/7/31 0031.
 */

public class CommonRestUsage extends AppBaseRestUsageV2 {

    private final String INDUSTRY_LIST = "/industry/industryList.do";//职业列表
    private final String WORK_TYPE_LIST = "/workType/workTypeList.do";//工作类型列表

    private final String COMMENT = "/report/saveReport.do";//保存意见反馈
    //    private final String TO_MYSELF_FOLLOW = "/attention/attentionList.do";//我的关注
    private final String TO_ADD_FOLLOW = "/user/toAddFollow.do";//关注
    private final String DEL_FOLLOW = "/user/delFollow.do";//取消关注

//    private final String TO_FANS = "/attention/fanList.do";//粉丝

    private final String ADD_OFFER = "/offer/addOffer.do";//添加报价
    private final String MY_OFFER = "/offer/myOffer.do";//报价查询


    /**
     * 职业列表
     *
     * @param taskId
     */
    public void industryList(int taskId) {
        Map<String, String> paramMap = new HashMap<>();
        post(INDUSTRY_LIST, Util.returnRealParam(paramMap), new NewCustomResponseHandler<ResultBean>(taskId) {
        }.setCallSuperRefreshUI(true));
    }

    /**
     * 工作类型列表
     *
     * @param taskId
     */
    public void workTypeList(int taskId) {
        Map<String, String> paramMap = new HashMap<>();
        post(WORK_TYPE_LIST, Util.returnRealParam(paramMap), new NewCustomResponseHandler<ResultBean>(taskId) {
        }.setCallSuperRefreshUI(true));
    }

    /**
     * 意见反馈
     *
     * @param taskId
     */
    public void comment(int taskId, String reason) {
        Map<String, String> paramMap = new HashMap<>();
        paramMap.put("reason", reason);
        post(COMMENT, Util.returnRealParam(paramMap), new NewCustomResponseHandler<ResultBean>(taskId) {
        }.setCallSuperRefreshUI(true));
    }

    /**
     * 我的关注
     *
     * @param taskId
     */
//    public void ToMyselfFollow(int taskId) {
//        Map<String, String> paramMap = new HashMap<>();
//        post(TO_MYSELF_FOLLOW, Util.returnRealParam(paramMap), new NewCustomResponseHandler<ResultBean>(taskId) {
//        }.setCallSuperRefreshUI(true));
//    }

    /**
     * 添加报价
     *
     * @param taskId
     */
    public void addOffer(int taskId, String workType, String workBreakdown, String offer, String offerMoney) {
        Map<String, String> paramMap = new HashMap<>();
        paramMap.put("workType", workType);
        paramMap.put("detailWork", workBreakdown);
        paramMap.put("offer", offer);
        paramMap.put("offerMoney", offerMoney);
        post(ADD_OFFER, Util.returnRealParam(paramMap), new NewCustomResponseHandler<ResultBean>(taskId) {
        }.setCallSuperRefreshUI(true));
    }

    /**
     * 报价查询
     *
     * @param taskId
     */
    public void getOfferList(int taskId) {
        Map<String, String> paramMap = new HashMap<>();
        post(MY_OFFER, Util.returnRealParam(paramMap), new NewCustomResponseHandler<ResultBean>(taskId) {
        }.setCallSuperRefreshUI(true));
    }
}
